﻿using System;
using GlobalStringFormatter;


namespace Samples.SimpleConsole
{
    public enum WholeUSD { }
    public enum WholeEuro { }

    class Program
    {
        static void Main(string[] args)
        {
            var gString = new GString<WholeUSD, int> { Value = 900 };

            gString.Value += 3;

            gString.Formatters.Add(value => (value < 1000), value => string.Format("${0}.00", value));
            gString.Formatters.Add(value => (value >= 1000 && value < 100000), value => string.Format("${0}k", value / 1000.00));
            gString.Formatters.Default = v => v.ToString();

            Console.WriteLine(gString);

            gString.Value += 10000;
            Console.WriteLine(gString);

            Console.ReadLine();
        }
    }
}
